<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/3/29 0029
 * Time: 14:17
 */

namespace app\admin\model;


use think\Model;

class Users extends Model
{
    public static function getUsersList(){
        $user=Users::paginate([

            'list_rows'=> 5,//每页数量

            'query' => request()->param(),

        ]);

        return $user;
    }
    public static function addUsersInfo($data){
        $user=new Users();
      try{
//          $user->add_time=date("Y-m-d H:i:s",time());
//          $user->upwd=md5($_POST['upwd']);
          $res=$user->save($data);
        //$res=Users::create($data);
            $msg="成功";
      }  catch (\Exception $e){
        $res=false;
        $msg=$e->getMessage();
      }
      return[$res,$msg];
    }

    public static function editUserList($data)
    {
        try{
            $res=Users::update($data);
            $msg='成功';
        }catch (\Exception $e){
            $res=false;
            $msg='失败';
        }
        return[$res,$msg];

    }

}